/*
 * @Author: Ryan Huang
 * @Description:
 * @Date: 2019-04-28 22:59:37
 */
package models

import (
	"github.com/astaxie/beego/orm"
	_ "github.com/go-sql-driver/mysql"
)

type User struct {
	id int
	username string "orm:size(100)"
}
const(
	name = "root"
	password = "root"
	host = "127.0.0.1"
	port = "3306"
	dbname = "users"
)
var dataSource = name+":"+password+"@tcp("+host+":"+port+")/"+dbname+"?charsetf=utf8"

func init() {
	orm.RegisterDataBase("default","mysql",dataSource,30)
	//orm.RegisterModel()
	//orm.RunSyncdb()
}
